package com.shrct.businessprocess.product.impl;

import com.shrct.businessprocess.product.RCAnonymousProductEntry;
import com.shrct.businessprocess.product.RCProductSpecification;
import com.shrct.businessprocess.product.RCRegisterAnonymousProductEvent;
import com.shrct.businessprocess.product.impl.RCAnonymousProductEntryEventImpl;
import com.shrct.businessprocess.product.proxy.RCRegisterAnonymousProductEventProxy;
import edu.fudan.mylang.pf.IObjectFactory;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;

@Entity
@DiscriminatorValue("RCREGISTERANONYMOUSPRODUCTEVENT_TYPE")
public class RCRegisterAnonymousProductEventImpl extends RCAnonymousProductEntryEventImpl implements RCRegisterAnonymousProductEvent {
  public RCRegisterAnonymousProductEventImpl() {
    super();
  }
  
  public RCRegisterAnonymousProductEventImpl(final RCAnonymousProductEntry product, final Integer count) {
    super( product);
    this.count = count;
  }
  
  private Integer count;
  
  public Integer getCount() {
    return this.count;
  }
  
  public RCRegisterAnonymousProductEvent setCount(final Integer count) {
    this.count = count;
    return this;			
    
  }
  
  public String getDescription() {
    RCAnonymousProductEntry _product = this.getProduct();
    RCProductSpecification _type = _product.getType();
    String _entityName = _type.getEntityName();
    String _plus = ("\u578B\u53F7:" + _entityName);
    String _plus_1 = (_plus + ",\u6570\u91CF:");
    String _plus_2 = (_plus_1 + this.count);
    return _plus_2;
  }
  
  public String getEventTitle() {
    return "\u65E0\u5E8F\u5217\u53F7\u8BBE\u5907\u5165\u5E93";
  }
  
  public static RCRegisterAnonymousProductEvent create(final RCAnonymousProductEntry product, final Integer count, final IObjectFactory objectFactory) {
    com.shrct.businessprocess.product.RCRegisterAnonymousProductEvent rCRegisterAnonymousProductEvent = new com.shrct.businessprocess.product.impl.RCRegisterAnonymousProductEventImpl(
    	product,count
    );
    objectFactory.create(rCRegisterAnonymousProductEvent);
    return rCRegisterAnonymousProductEvent;			
    
  }
  
  public static RCRegisterAnonymousProductEvent createRCRegisterAnonymousProductEventImpl(final RCAnonymousProductEntry product, final Integer count, final IObjectFactory objectFactory, final Procedure1<RCRegisterAnonymousProductEvent> init) {
    com.shrct.businessprocess.product.RCRegisterAnonymousProductEvent rCRegisterAnonymousProductEvent = new com.shrct.businessprocess.product.impl.RCRegisterAnonymousProductEventImpl(
    	product,count
    );
    objectFactory.create(rCRegisterAnonymousProductEvent);
    init.apply(rCRegisterAnonymousProductEvent);
    
    return rCRegisterAnonymousProductEvent;			
    
  }
  
  public RCRegisterAnonymousProductEventProxy toProxy() {
    com.shrct.businessprocess.product.proxy.RCRegisterAnonymousProductEventProxy proxy = new com.shrct.businessprocess.product.proxy.RCRegisterAnonymousProductEventProxy();
    proxy.setId(this.getId());
    if(this instanceof edu.fudan.mylang.pf.INamedModelObject){
    	proxy.setName(((edu.fudan.mylang.pf.INamedModelObject)this).getEntityName());
    }
    return proxy;
    
  }
}
